package com.biodiv.common.message;

import com.biodiv.common.instance.ServiceInstance;

import java.time.LocalDateTime;
import java.util.Map;
import java.util.Set;

/**
 *@Author: tianquan
 *@date: 2024-11-04  10:10
 *@Description: 服务变更消息
 */
public class ServiceUpdateMessage extends AbstractResponseMessage{

    private final Map<String, Set<ServiceInstance>> instances;

    public LocalDateTime localDateTime;

    public ServiceUpdateMessage(boolean success, Object reason, Map<String, Set<ServiceInstance>> instances) {
        super(success, reason);
        this.instances = instances;
        localDateTime = LocalDateTime.now();
    }

    public Map<String, Set<ServiceInstance>> getInstances() {
        return instances;
    }

    public LocalDateTime getLocalDateTime() {
        return localDateTime;
    }

    @Override
    public int getMessageType() {
        return ServiceUpdateMessage;
    }
}
